package com.quanyan.club.mq.producer;

import com.quanyan.common.constants.MqConstants;
import com.quanyan.mq.mq.producer.AbstractMqProducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Created by zhang on 16/8/10.
 */
@Component
public class ClubMedalProducer extends AbstractMqProducer {

    private final static Logger logger = LoggerFactory.getLogger(ClubMedalProducer.class);

    @Value("${mq.nameServer.address}")
    private String nameServerAddress;

    @Override
    protected String getProducerGroup() {
        return MqConstants.ClubMedalProducer.CLUB_MEDAL_GROUP;
    }

    @Override
    protected String getNameServerAddress() {
        return this.nameServerAddress;
    }

    @Override
    protected String getInstanceName() {
        return MqConstants.ClubMedalProducer.CLUB_MEDAL_INSTANCE;
    }

    @PostConstruct
    @Override
    public void start() {
        super.start();
        logger.info("俱乐部勋章producer启动成功");
    }
}
